package com.ts.conch.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ts.conch.entity.TsMenu;
import com.ts.conch.entity.TsPermission;
import com.ts.conch.entity.TsRole;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ItsRoleDao extends BaseMapper<TsRole> {
    @Select("select name from ts_role")
    List<String> getRoleNameList();

    /**
     * @return java.util.List<UmsMenu>
     * @method getMenuList
     * create by: IDai
     * description: 根据后台用户ID获取菜单
     * create time: 2020-08-17 17:43
     * @Param: [adminId]
     */
    List<TsMenu> getMenuList(@Param("adminId") String adminId);

    /**
     * @return java.util.List<com.lr.iboot.api.entity.LrMenu>
     * @method getMenuListByRoleId
     * create by: IDai
     * description: 根据角色ID获取菜单
     * create time: 2020-08-18 9:16
     * @Param: [roleId]
     */
    List<TsMenu> getMenuListByRoleId(@Param("roleId") String roleId);


    /**
     * @return java.util.List<UmsResource>
     * @method getResourceListByRoleId
     * create by: IDai
     * description: 根据角色ID获取资源
     * create time: 2020-08-18 9:20
     * @Param: [roleId]
     */
    List<TsPermission> getPermissionListByRoleId(@Param("roleId") String roleId);

    int deleteByPrimaryKey(Long id);

    int insertSelective(TsRole record);

    TsRole selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(TsRole record);

    int updateByPrimaryKey(TsRole record);

}